<#import "../import/CommonVar.ftl" as var>
<!DOCTYPE html>
<html>
<head>
<title>数据列表</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<@var.listjscss/>
</head>
<body>
<fieldset class="search-field">
    <legend>搜索条件</legend>
    <table class="searchbox-list">
        <tr><td>开始时间：<input type="text" class="easyui-datetimebox" id="txtStartTime"> 结束时间：<input type="text" class="easyui-datetimebox" id="txtEndTime">
       </td><td> <input class="easyui-searchbox" data-options="prompt:'请输入关键词',menu:'#mmStatus',searcher:doSearch" style="width:300px">
            <div id="mmStatus" style="width:120px">
                <div data-options="name:'all',iconCls:'icon-ok'">全部</div>
                <div data-options="name:'1'">启用</div>
                <div data-options="name:'2'">禁用</div>
                <div data-options="name:'-1'">已删除</div>
            </div></td></tr>
    </table>
</fieldset>
	<@toolbar moduleCode="SysEnumName" id="toolbar"/>
	<table id="dataList" class="easyui-datagrid" style="height: 400px;">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				#foreach($c in $ColumnList)
					#if(${Utils.ToLower($c.ColumnName)}=="status")
						<th data-options="field:'${c.ColumnNameAlias}',width:180,formatter:function(value){return getEnumText(Enum.SwitchStatus,value,1);}">${c.ColumnMemo}</th>
					#elseif(${Utils.ToLower($c.ColumnName)}=="sort")
					<th data-options="field:'${c.ColumnNameAlias}',width:180,editor:'numberbox'">${c.ColumnMemo}</th>
					#elseif(${Utils.ToLower($c.ColumnName)}!="id"&&${Utils.ToLower($c.ColumnName)}!="createdate")
						<th data-options="field:'${c.ColumnNameAlias}',width:180">${c.ColumnMemo}</th>
					#end
				#end
				<th
					data-options="field:'id',formatter:function(value,row){return getOperate(value,row);}">操作</th>
			</tr>
		</thead>
	</table>
	<script type="text/javascript">
        var url = '../${table.TableNameAlias}/getList.do';
		jQuery(function() {
            initDataGrid(url, "");
		});
		function del()
		{
            delFromgrid("datagrid");
		}
		function audit(state)
		{
            setAudit(state,"datagrid");
		}
	  function view(id,index) {
			jQuery.dialog.open("view.do?id=" + id, {
				title : "详细信息",
				id : "viewdetail" + Math.round(1000),
				lock : true,
				fixed : false,
				resize : false,
				width : "550px",
				button : [ {
					name : '关闭',
					focus : true
				} ]
			}, true);
		}
		function edit(id,index) {
			openDoWin("do/edit.do?id=" + id, 550);
		}

		function add() {
			openDoWin("do/add.do", 550);
		}
    
        /**
         * 刷新树
         *
         * @param id
         */
        function reloadgrid(id) {
            jQuery("#" + id).datagrid("reload");
        }
        function doSearch(key,status)
        {
            //alert(key+"  "+status)
           var startTime= jQuery("#txtStartTime").datetimebox("getValue");
            var endTime=jQuery("#txtEndTime").datetimebox("getValue");
            //alert(startTime);
            var params={startTime:startTime,endTime:endTime,key:key,status:status};
            initDataGrid(url,params);
        }
	</script>
	<@operateMenu moduleCode="${table.TableNameAlias}"/>
</body>
</html>